<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
   
     
     <title>Invitation</title>
   
    <body>
        <h:form>


<style>
            p { 
                position: relative;
                color: black;
                font: x-large/90% "Century Gothic", serif;
                margin-left: 10px;
            width: 100%;}
        </style>
            
               <p:panel style="width: 250px; border-style: solid; border-color: black; position: relative;">
                   <p> Users can be invited</p>
                <p:panelGrid columns="1" >
                    <p:dataTable value="#{invitationbean.returnallusers()}" var="item" style=" position: relative; margin-left: 50px; margin-bottom: 20px">
                    
                        
                        
                            <p:column> 
                            <f:facet name="header">
                                <h:outputText value="Username"/>
                            </f:facet>
                                <h:outputText value="#{item.username}"/>
                         </p:column>    
                        
                           
                            
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Email"/>
                            </f:facet>
                            <h:outputText value="#{item.email}"/>
                            </p:column>
                          
                    </p:dataTable>
                   
             
             </p:panelGrid> 
                   
        </p:panel>
        
        <p:panelGrid columns="2" id="regGrid">
            <h:outputLabel  for="username">UserName:</h:outputLabel>
            <p:inputText  id="username" value="#{invitationbean.usernameInvited}" required="true" />
            <h:outputLabel  for="email">Email:</h:outputLabel>
            <p:inputText  id="email" value="#{invitationbean.emailInvited}" required="true" />
            
        <p:commandButton id="addinvitation" style="background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%); border: double; border-color: black; border-width: 3px; color: black; height: 3em; margin-top: 1.5em; font-size: medium " value="Add Invitation" update="regGrid"
                         action="#{invitationbean.addInvitationUser}"  />

        <p:commandButton id="setinvitation" style="background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%); border: double; border-color: black; border-width: 3px; color: black; height: 3em; margin-top: 1.5em; font-size: medium " value="Set Invitation" update="regGrid"
                         action="#{invitationbean.setInvitationUser}"  />
            
        </p:panelGrid>
        

        
        <p:button style="background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%); border: double; border-color: black; border-width: 3px; color: black; height: 3em; margin-top: 1.5em; margin-left: 0; font-size: medium; width: 5em" outcome="calendar" value="Back"/>
                
</h:form>
    </body>
</html>
